// 创建类组件模板代码
import React from "react";
import { Switch, Route, Redirect } from 'react-router-dom'
import Loading from "../components/Loading";
const RouterViews = (props) => {
    const { routes } = props
    return (
        <div className="routerviews">
            <React.Suspense fallback={< Loading />}> 
                <Switch >
                        {
                            routes.map((item) => <Route key={item.path} path={item.path} component={() => (<item.component />)}></Route>)
                        }
                    <Redirect from='/' to='/Loginverifycode'></Redirect>
                </Switch>
            </React.Suspense>
        </div>
    )
}
export default RouterViews
